package com.example.base.net

import com.example.base.entity.AddEntity
import com.example.base.entity.CodeEntity
import com.example.base.entity.LoginEntity
import com.example.base.entity.OrderEntity
import com.example.base.mvvm.Res
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Query

interface ApiService {
    @POST(Const.LOGIN_URL)
    suspend fun login(@Body body:RequestBody):Res<LoginEntity>
    @POST(Const.REGISTER_URL)
    suspend fun register(@Body body: RequestBody):Res<LoginEntity>
    @POST(Const.CODE_URL)
    suspend fun code(@Query("phone")phone:String):Res<CodeEntity>
    @GET(Const.ORDER_URL)
    suspend fun order(@Query("type")type:String,@Query("limit")limit:Int,@Query("page")page:Int):Res<OrderEntity>
    @POST(Const.CANCEL_URL)
    suspend fun cancel(@Query("id")id:Int):Res<String?>
    @POST(Const.ADD_URL)
    suspend fun add(@Body body: RequestBody):Res<AddEntity>
    @POST(Const.REFUND_URL)
    suspend fun refund(@Body body: RequestBody):Res<String?>
}